import java.awt.Color;
import java.awt.Graphics;
import java.awt.Paint;


public class Fondo {
	private int vy,y;
	private Multimedia mult;	
	private VirtualGT vgt;
	private boolean menu=true;
	private boolean gameover=false;
	private boolean menuseleccion=false;
	private boolean continuar=false;
	private boolean gano=false;
	static String hip;
	
	public boolean isContinuar() {
		return continuar;
	}

	public void setContinuar(boolean continuar) {
		this.continuar = continuar;
	}

	public Fondo(VirtualGT vgt, Multimedia mul) {
		// TODO Auto-generated constructor stub
		this.mult=mul;
		this.vgt=vgt;
		y=0;
		vy=1;//velocidad del fondo;
	}

	public boolean isGameover() {
		return gameover;
	}

	public void setGameover(boolean gameover) {
		this.gameover = gameover;
	}

	public void Actualizar(){
		if(y < vgt.getHeight()){//anima el movimiento del fondo
			y += vy;				
		}else{
			y = 0;
		}
	}
	
	public boolean isMenu() {
		return menu;
	}

	public void setMenu(boolean menu) {
		this.menu = menu;
	}

	public boolean isMenuseleccion() {
		return menuseleccion;
	}

	public void setMenuseleccion(boolean menuseleccion) {
		this.menuseleccion = menuseleccion;
	}

	public void paint(Graphics g){
		g.drawImage(mult.fondo,0,y,vgt);
		g.drawImage(mult.fondo,0,y-vgt.getHeight(),vgt);
		g.drawImage(mult.fondogt,0,0,vgt);
		//menu - play - x=246 y=268 w=525-x h=332-y
		//-instrucciones - x=155 y=368 w=663-x h=430-y 
		if(menu){
			g.drawImage(mult.menu,0,0,vgt);
		}
		if(menuseleccion){
			g.drawImage(mult.menuSeleccion,0,0,vgt);						
		}
		if(gano){
			g.drawImage(mult.nivelfinal,0,0,vgt);
			g.setColor(Color.white);
			g.drawString("Hipervisor: "+hip, 120, 400);
			//Multimedia.gano.play();
		}		
	}
	public void SiguienteNivel(Graphics g){
		if(!gano)
			g.drawImage(mult.continuar,0,0,vgt);		
	}
	public void MenuGameOver(Graphics g){
		g.drawImage(mult.gameOver,0,0,vgt);
	}

	public void Instrucciones(Graphics g,int num){
		g.drawImage(mult.pasos[num],0,0,vgt);
	}
	
	public boolean isGano() {
		return gano;
	}

	public void setGano(boolean gano) {
		this.gano = gano;
	}
	
}
